In the event that I am ill, and I will get ill since I have a child in daycare, class will be delivered live online.
There are different links for lectures and labs, so if you log on to one and nobody is there, check the other link. The links are on the next 2 slides. These are the same links for each lab/lecture whether I am delivering material from the classroom or my basement.
David Feinberg is inviting you to a scheduled Zoom meeting.
Topic: PNB 2A03 Lectures Time: Jan 5, 2023 12:30 PM Eastern Time (US and Canada)
Please download and import the following iCalendar (.ics) files to your calendar system.
Weekly: https://mcmaster.zoom.us/meeting/tJYlf-2vqDMtG9N87fa6HRvzAI_7X_84kdvz/ics?icsToken=98tyKuCqpjMuHdKdtxiARowQGoqgLO3wplxajfpzxEjjAnZ7UBXsF8t9ZYpASIzb
Join Zoom Meeting
https://mcmaster.zoom.us/j/92884768717?pwd=c0pXMWRyb3dFS2Vvd0lCdjlvZFBqZz09
Meeting ID: 928 8476 8717
Passcode: 380562
One tap mobile
Dial by your location
Meeting ID: 928 8476 8717
Passcode: 380562
Find your local number: https://mcmaster.zoom.us/u/asGiNUVhB
Join by SIP
92884768717@zoomcrc.com
Join by H.323
Meeting ID: 928 8476 8717
Passcode: 380562
David Feinberg is inviting you to a scheduled Zoom meeting.
Topic: PNB 2A03 Labs Time: Jan 5, 2023 03:30 PM Eastern Time (US and Canada)
Join Zoom Meeting
https://mcmaster.zoom.us/j/95379150603?pwd=aTRjcTU4UW1SYnVYSjc3dCtwRHVSUT09
Meeting ID: 953 7915 0603
Passcode: 376220
One tap mobile
Join by SIP 95379150603@zoomcrc.com
Join by H.323
Meeting ID: 953 7915 0603
Passcode: 376220
print("Hello, world!")
Hello, world!
a = 1
b = 2
c = a + b
print(c)
3
import math
math.sqrt(81)
9.0
import statistics
x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print("Mean of x: ", statistics.mean(x))
print("Standard deviation of x: ", statistics.stdev(x))
print("Variance of x: ", statistics.variance(x))
Mean of x: 5 Standard deviation of x: 3.3166247903554 Variance of x: 11
from scipy.stats.stats import pearsonr
a = [1, 4, 6, 8, 10, 12]
b = [1, 2, 3, 4, 5, 2]
r, p = pearsonr(a,b)
print("The correlation coefficient between a & b is r = {}".format(r))
print("The p-value of that correlation is p = {}".format(p))
if p < 0.05:
print("The correlation is significant at p < 0.5")
elif p > 0.05:
print("The correlation is not significant at p < 0.5")
The correlation coefficient between a & b is r = 0.5688448442065138 The p-value of that correlation is p = 0.23876740864265822 The correlation is not significant at p < 0.5
import matplotlib
import matplotlib.pyplot as plt
%matplotlib
plt.scatter(a, b)
plt.show()
Using matplotlib backend: Qt5Agg
try:
import youtube_dl
except:
!pip install youtube-dl
import youtube_dl
import pandas as pd
song_list = [
'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
]
ydl_opts = {
'format': 'best',
'outtmpl': 'my_favourite_song.webm'
}
for song in song_list:
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([song])
[youtube] dQw4w9WgXcQ: Downloading webpage [youtube] dQw4w9WgXcQ: Downloading player e5f6cbd5 [download] Destination: my_favourite_song.webm [download] 100% of 8.70MiB in 01:5979KiB/s ETA 00:001
import io
import base64
from IPython.display import HTML
video = io.open('my_favourite_song.webm', 'r+b').read()
encoded = base64.b64encode(video)
HTML(data='''<video alt="test" controls>
<source src="data:video/webm;base64,{0}" type="video/webm" />
</video>'''.format(encoded.decode('ascii')))